﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using UPC.UbicaTuReu.WEB.Dominio;

namespace UPC.UbicaTuReu.WEB.Models
{
    public class SalaModels
    {

        SalaObjectDataContext db;

        //IEnumerable
        public ICollection<Salas> CargarSalas()        
        {
            
            db = new SalaObjectDataContext();

            List<Salas> lstSalas = (from s in db.Salas
                                    select new Salas{
                                        SalaID = s.SAL_ID, SalaNombre= s.SAL_NOMBRE } ).ToList();

            //var oSalas = from s2 in lstSalas
            //             orderby s2.SAL_NOMBRE
            //             select s2;

            //return oSalas;
            return lstSalas;
        }

        public ICollection<Horario> CargarHoras()
        {
            Horario oHora;
            List<Horario> lstHoras = new List<Horario>();

            for (int i = 9; i <= 20; i++)
            {
                oHora = new Horario();
                oHora.Hora = i.ToString();
                lstHoras.Add(oHora);
            }

            return lstHoras;
        }

        
    }
}